;var module = angular.module('CtrlsContent');
module.controller('WenkubuyCtrl',['$scope','api_other','wenku_service','$stateParams','$state','weixinbuy_service',function($scope,api_other,wenku_service,$stateParams,$state,weixinbuy_service){
	$scope.title = $stateParams.title;
	$scope.price = $stateParams.price;
	$scope.event = {
		submit:function(){
			var obj = {
				catId:localStorage.catId,
				userId:localStorage.bls_userId
			};
			var pro = api_other.wenkudingdan(obj);
			pro.success(function(data){
				if(data.returnCode == 0){
					var orderId = data.returnData.orderId;
					weixinbuy_service.submit(orderId,1);
				}
			});
		},
		back:function(){
			$state.go('wenkugoumailist',{type:$stateParams.type})
		}
	};
}]);